import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StuinsQuery, CuionseVO, TonscuCine, HandleTio, Linsecone, Huonceiet } from './types';

/**
 * 查询切片达人列表
 */
export const listOrder = (query: StuinsQuery): AxiosPromise<TableInfoVO<CuionseVO>> => {
  return request({
    url: '/section/list',
    method: 'GET',
    params: query
  });
};

/**
 * 达人切片添加
 */
export const getRefund = (data: TonscuCine) => {
  return request({
    url: `/section`,
    method: 'POST',
    data: data
  });
};

/**
 * 达人切片编辑，下架才显示编辑按钮
 */
export const putccanel = (data: TonscuCine) => {
  return request({
    url: `/section`,
    method: 'PUT',
    data: data
  });
};

/**
 * 达人切片上下架
 */
export const enableGoods = (id: string | number) => {
  return request({
    url: `/section/enable/${id}`,
    method: 'PUT'
  });
};

/**
 * 切片达人详情
 */
export const getdefuis = (id: string | number) => {
  return request({
    url: `/section/${id}`,
    method: 'GET'
  });
};

/**
 * 申请达人切片用户列表
 */
export const getlostics = (query: Linsecone): AxiosPromise<TableInfoVO<Huonceiet>> => {
  return request({
    url: `/section/apply/list`,
    method: 'GET',
    params: query
  });
};

/**
 * 申请处理 0=>1,1=>2或者1=>3
 */
export const statisui = (data: HandleTio) => {
  return request({
    url: '/section/apply/handle',
    method: 'PUT',
    data: data
  });
};
